@extends('admin.formLayout')
@if(isset($id))
@section('title','修改活动')
@section('barName','修改活动')
    @else
        @section('title','增加活动')
        @section('barName','增加活动')
    @endif

@section('content')
<form class="layui-form" @if(isset($id)) action="{{route('admin.activity_update')}}" @else action="{{route('admin.activity_store')}}" @endif method="post">
    {{csrf_field()}}
    @if(isset($id))
 <input type="hidden" name="id" value="{{$id}}">
    @endif
    <div class="layui-form-item">
        <label class="layui-form-label">活动标题</label>
        <div class="layui-input-block">
            <input type="text" name="title" lay-verify="required"  value="{{$model->title or ''}}" autocomplete="off" placeholder="请输入活动标题" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">活动缩略图</label>
        <div class="layui-input-block">
            @include('admin.form.image',['name'=>'image','value'=>isset($model->image) ? $model->image : ''])
        </div>
    </div>
    <div class="layui-inline">
        <label class="layui-form-label">活动有效时间</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input" id="test10" name="date" @if(isset($model)) value="{{$model->start_time.' ~ '.$model->end_time}}"@endif style="width: 400px" lay-verify="required" placeholder="请输入活动有效时间">
        </div>
    </div>
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">活动内容</label>
        <div class="layui-input-block">
            <textarea class="layui-textarea layui-hide" name="content1"  id="editor">{{$model->content or ''}}</textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="" lay-filter="form">立即提交</button>
            <button type="button"  onclick="javascript:location.href='{{route('admin.activity_index')}}'" class="layui-btn layui-btn-primary">返回</button>
        </div>
    </div>
</form>
@endsection